/******************************************************************************/
/*                                                                            */
/*  Copyright (c) 2007-2009: ngi-central.org                                  */
/*  All rights reserved.                                                      */
/*                                                                            */
/******************************************************************************/

/// \file
/// This file implements the real concept, which is used to check if some type
/// has the properties of a real number.

#ifndef __sgl_real_concept_h__
#define __sgl_real_concept_h__

#include <sgl/global_settings.h>
#include <sgl/conditions.h>
#include <boost/concept_check.hpp>

namespace sgl {


/******************************************************************************/
/*                                                                            */
/* real_concept                                                               */
/*                                                                            */
/******************************************************************************/

template <
	/// The type to be checked.
	typename X>
/// This checks if a type qualifies for the real concept.
//!
//! The types float, double and long double qualify for the real concept.
struct real_concept
{
	BOOST_CONCEPT_USAGE(real_concept)
	{
		// This error is triggered when the type X is not a real type.
		// Real types are float, double and long double (see the specializations
		// below).
		x.error_type_must_be_a_real_type();
	}
private:
	X x;
};

template <> struct real_concept<float> {};
template <> struct real_concept<double> {};
template <> struct real_concept<long double> {};

} // namespace sgl

#endif // __sgl_real_concept_h__
